package LoopTest;

import java.util.Random;
import java.util.Scanner;

public class test {
    public static void main(String[] args) {
        Random r= new Random();
        int num=r.nextInt(100)+1;
        Scanner sc=new Scanner(System.in);
        while (true){
            System.out.println("请输入一个1-100之间的整数");
            int guessNumber =  sc.nextInt();
            if(guessNumber>num) {
                System.out.println("大了");
            }else if(guessNumber<num){
                System.out.println("小了");
            }else{
                System.out.println("恭喜你猜对了");
                break;
            }

        }
    }
}
